#include<iostream>
#include "../source/public.h"
using namespace std;

static framework::Logger::ptr g_logger = FRAMEWORK_LOG_ROOT();

void test_fiber()
{
    FRAMEWORK_LOG_INFO(g_logger) << "test in fiber =============";
    sleep(1);
    framework::Scheduler::GetThis()->schedule(&test_fiber);
}

int main(void)
{
    FRAMEWORK_LOG_INFO(g_logger) << "beign";
    framework::Scheduler sc(2, true, "test");
    sc.schedule(&test_fiber);
    sc.start();

    sc.stop();
    FRAMEWORK_LOG_INFO(g_logger) << "over";

    return 0;
}